﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link type="text/css" rel="Stylesheet" href="css/StyleSheet.css" />
    <script type="text/javascript">
        function checkall() {
        var TargetBaseControl = document.getElementById('<%= this.gvTaiKhoang.ClientID %>');
        var Inputs = TargetBaseControl.getElementsByTagName("input");
        for (var n = 0; n < Inputs.length; ++n)
             if(Inputs[n].type == 'checkbox')
                Inputs[n].checked = true;
    }

    function bochon() {
        var TargetBaseControl = document.getElementById('<%= this.gvTaiKhoang.ClientID %>');
        var Inputs = TargetBaseControl.getElementsByTagName("input");
        for (var n = 0; n < Inputs.length; ++n)
            if (Inputs[n].type == 'checkbox')
                Inputs[n].checked = true;
    }
    </script>
</head>
<body>   
    <div>
    <div id="topmenu">
        <ul id="menu">  
            <asp:Repeater ID="rep" runat="server">       
                <ItemTemplate>
                     <li class="menu"><a href="#"> <%#DataBinder.Eval (Container.DataItem, "manv") %></a></li>
                </ItemTemplate>
            </asp:Repeater>    
        </ul>
     </div>
  <h1>Danh sách nhân viên</h1>
  <form id="form1" runat="server" name="f">
        nhap ten<asp:TextBox ID="txtsearch" runat="server"></asp:TextBox>
        <asp:Button ID="btsearch" runat="server" OnClick="btsearch_Click" Text="Search" />
        <asp:GridView ID="gvTaiKhoang" runat="server" OnPageIndexChanging="gvTaiKhoang_PageIndexChanging" Width="800px">
            <Columns>    
                 <asp:TemplateField HeaderText="Chọn">
                    <ItemTemplate>
                      <asp:CheckBox ID="ckxoa" runat="server" name="check"/>
                    </ItemTemplate>
                </asp:TemplateField>  
                <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <a href="Default.aspx?action=delete&manv=<%#Eval("manv").ToString() %>">Xóa</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="sửa"  >
                    <ItemTemplate>
                                <a href="Default.aspx?action=edit&manv=<%#Eval("manv").ToString() %>">Sửa</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <asp:Label ID="lblSTT" runat="server"><%#getstt() %></asp:Label>
                    </ItemTemplate> 
                </asp:TemplateField>   
            </Columns>
        </asp:GridView>
        <asp:Button ID="btall" Text="check all" runat="server" onclick="btall_Click" />
        <a href="Default.aspx?action=add">Add nhân viên</a>
        <a href="#" runat="server" onclick="checkall()">check all</a>
        <asp:Button ID="btxoa" Text="xoa" runat="server" onclick="btxoa_Click" />
        <a href="#" onclick="bochon()"> Bỏ chọn</a>
        <asp:DataList ID="datal" runat="server">
            <ItemTemplate>
                <div class="divnv">
                    <h1>
                        <%#Eval("manv").ToString() %></h1>
                    <%#Eval("tennv").ToString() %>
                </div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    </form>
</body>
</html>
